indicator.
for(pdb_rec = pdb->rec_index.rec; pdb_rec; pdb_rec=pdb_rec->next) {
waypoint *wpt_tmp;
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
rec = (struct record *) pdb_rec->data;
if ( be_read32(&rec->elevation) == -100000000 ) {
waypoint *wpt_tmp;
char *vdata;
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
rec = (struct record *) pdb_rec->data;
wpt_tmp->longitude =
}
if (strlen(buff)) {
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
s = buff;
s = csv_lineparse(s, xcsv_file.field_delimiter, "", linecount);
char gid[6+1];
struct tm tm;
- wpt = xcalloc(sizeof(*wpt), 1);
+ wpt = waypt_new();
if (!wpt)
fatal(MYNAME ": Couldn't allocate waypoint.\n");
vdata = (char *) pdb_rec->data;
waypoint *wpt_tmp;
char *vdata;
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
rec = (struct record *) pdb_rec->data;
wpt_tmp->longitude = be_read32(&rec->longitude) / 3.6e6;
sscanf(&ibuf[70], "%2c", icon);
rtrim(desc);
rtrim(icon);
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
wpt_tmp->altitude = alt;
wpt_tmp->shortname = xstrdup(name);
wpt_tmp->description = xstrdup(desc);
/* Get the waypoints */
for (iCount = 0; iCount < iWptNum ; iCount ++)
{
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
iWptIndex = le_read16(&((WPTHDR *)HxWpt)->idx[iCount]);
pWptHxTmp = (WPT *)&HxWpt[OFFS_WPT + (sizeof(WPT) * iWptIndex)];
struct tm tm;
memset (&tm, sizeof(tm), 0);
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
rec = (struct record *) pdb_rec->data;
wpt_tmp->altitude = be_read32(&rec->elevation);
edata = (char *) rec + pdb_rec->data_len;
for (; vdata < edata; rec = (struct record *) vdata) {
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
wpt_tmp->latitude = Lat1 +
be_read16(&rec->lat1d) / LATDIV2;
wpt_tmp->longitude = Lon1 +
my_fread4(&wpt_count, mapsend_file_in);
while (wpt_count--) {
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
if (fread(&scount, sizeof(scount), 1, mapsend_file_in) < 1) {
fatal(MYNAME ": out of data reading %d waypoints\n",
my_fread4(&wpt_count, mapsend_file_in);
while (wpt_count--) {
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
/* waypoint name */
fread(&scount, sizeof(scount), 1, mapsend_file_in);
centisecs = 0;
}
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
wpt_tmp->latitude = -wpt_lat;
wpt_tmp->longitude = wpt_long;
wpt_tmp->creation_time = time;
&symnum);
desc[sizeof(desc)-1] = '\0';
name[sizeof(name)-1] = '\0';
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
wpt_tmp->altitude = alt;
wpt_tmp->shortname = xstrdup(name);
wpt_tmp->description = xstrdup(desc);
pincount = le_read16(&buff[12]);
while (pincount--) {
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
wpt_tmp->altitude = unknown_alt;
while (fgets(ibuf, sizeof(ibuf), file_in)) {
if( sscanf(ibuf, "%lf,%lf:%100[^:]:%100[^\n]",
&lon, &lat, icon, desc)) {
- wpt_tmp = xcalloc(sizeof (*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
wpt_tmp->longitude = lon;
wpt_tmp->latitude = lat;
/* skip the line if it contains "sHyperLink" as it is a header (I hope :) */
if ((strlen(buff)) && (strstr(buff, "sHyperLink") == NULL)) {
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = waypt_new();
/* data delimited by tabs, not enclosed in quotes. */
s = buff;
while (pointcount--) {
- wpt_tmp = xcalloc(sizeof(*wpt_tmp),1);
+ wpt_tmp = waypt_new();
/* 1 bytes at start of record - string size for shortname */
tpg_fread(&buff[0], 1, 1, tpg_file_in);